const Service = require('egg').Service;
class MovieService extends Service {
// 添加数据
async add({mname,score,time,desc,dire}){
  const sql = `select `
  const data=await this.app.mysql.insert('movie',{mname,score,time,desc,dire})
  console.log(data)
  return data
}

    // search搜索框查询
  async search(info) {
    console.log(info)
    const sql=`select * from movie where mname like '%${info}%'`;
    const data = await this.app.mysql.query(sql);
    return data;
    // return '11111'
  }

//   正在热映
  async getmovie(){
    const data=await this.app.mysql.query(`select * from movie`)
    console.log(data)
    return data
  }
}
module.exports = MovieService;